package com.cloudpolice.equipment.service.Impl;

import com.cloudpolice.equipment.dao.EquipmentParamMapper;
import com.cloudpolice.equipment.model.EquipmentParamDefaultModel;
import com.cloudpolice.equipment.model.EquipmentParamModel;
import com.cloudpolice.equipment.service.EquipmentParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：梁昊，后端工程师：卢春龙，前端工程师：孙耀
 * @create 2020-04-20 19:58
 * @function
 * @editLog
 */
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Service
public class EquipmentParamServiceImpl implements EquipmentParamService {
    @Autowired
    EquipmentParamMapper equipmentParamMapper;

    /**
     * 根据sn号删除设备参数
     *
     * @param sn
     * @return 结果
     */
    @Override
    public int deleteEquipmentParamBySn (String sn) {
        return equipmentParamMapper.deleteEquipmentParamBySn(sn);
    }


    /**
     * 修改设备参数
     *
     * @param equipmentParamModel com.cloudpolice.equipment.model.InPutParam.EquipmentParamModel
     * @return 结果
     */
    @Override
    public int updateEquipmentParam (EquipmentParamModel equipmentParamModel) {
        return equipmentParamMapper.updateEquipmentParam(equipmentParamModel);
    }

    /**
     * 通用查询设备参数
     *
     * @param equipmentParamModel 通用查询设备参数
     * @return 明细
     */
    @Override
    public List<EquipmentParamModel> selectEquipmentParamAll(EquipmentParamModel equipmentParamModel) {
        return equipmentParamMapper.selectEquipmentParamAll(equipmentParamModel);
    }


    /**
     * 插入设备默认参数
     *
     * @param equipmentParamModel com.cloudpolice.equipment.model.InPutParam.EquipmentParamModel
     * @return 结果
     */
    @Override
    public int insertEquipmentParamDefault (EquipmentParamModel equipmentParamModel) {
        return equipmentParamMapper.insertEquipmentParamDefault(equipmentParamModel);
    }

    /**
     * 插入设备默认参数
     *
     * @param sn com.cloudpolice.equipment.model.InPutParam.EquipmentParamModel
     * @return 结果
     */
    @Override
    public int insertEquipmentParamDefaultBeforeCheck(String sn) {
        return equipmentParamMapper.insertEquipmentParamDefaultBeforeCheck(sn);
    }

    /**
     * 获取设备默认参数
     *
     * @return 结果集
     */
    @Override
    public List<EquipmentParamDefaultModel> getEquipmentParamDefault() {
        return equipmentParamMapper.getEquipmentParamDefault();
    }

}

